<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>修改类别</title>
</head>
<body style="text-align:center">
	<h2>修改类别</h2>
	<form method="post" action="editCategory">
		<input name="id" value="${edit.id}" type="hidden" />
	        类别名称：<input name="name" value="${edit.name}" /><br>
	    <input type="button" value="确定" onclick="submitAdd()" />
	</form>
</body>
</html>
<script type="text/javascript">
function submitAdd(){
	// 非空判断
	let name = document.getElementsByName('name')[0].value;
	if(name == ''){ alert("类别名称必须填写") }
	else{
		document.getElementsByTagName("form")[0].submit();
	}
}
</script>